// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.

import Vue from 'vue'
import App from './App'
import router from './router'
import axios from 'axios'
import stores from './store/index.js'
import 'jquery'



//引入全局的CSS文件
require('../static/css/zpui.css');
require('../static/css/all.css');

//引入全局的JS文件
require('../static/js/page.js');


//axios的一些配置，比如发送请求显示loading，请求回来loading消失之类的
//
axios.interceptors.request.use(function (config) {  //配置发送请求的信息
  stores.dispatch('showloader')
  return config;
}, function (error) {
  return Promise.reject(error);
});

axios.interceptors.response.use(function (response) { //配置请求回来的信息
  stores.dispatch('hideloader')
  return response;
}, function (error) {

  return Promise.reject(error);
});
Vue.prototype.$http = axios;  //其他页面在使用axios的时候直接  this.$http就可以了



/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  store:stores,
  components: { App },
  template: '<App/>',
})
